<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/admin.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->_webroot('skin/css/main.css'); ?>">

<style>
td span {color:red;}
.green {color:green;}
.red {color:red;}
</style>
</head>
<body>
<input type="hidden" id="pay_oper" value="1">
<div id="maincontent">
<psp:tags     htmlname='messagebox'  iconname='messagebox' />
	<div class="wrap">
    <div class="crumbs">当前位置 &gt;&gt; 系统设置 &gt;&gt; 支付接口</div>
        <hr />
	
		
	<div class="infobox">
    <h3>支付接口设置</h3>
    <div class="content2">
		<table class="list_table">
		 <thead>
            <tr style="text-align:center;">
				<th width="90px" align="left">接口名称</th>
				<th width="90px">文件夹名称</th>
				<th>描述</th>
				<th width="85px">作者</th>
				<th style="width:40px;">版本</th>
				<th style="width:70px;">当前状态</th>
				<th style="width:40px;">操作</th>
			</tr>
		  </thead>
		  <tbody>
		<?php foreach($payment as $value) { ?>
			<tr style="text-align:center;">
				<td align="left"><?php echo $value['pay_name'];?></td>
				<td><?php echo $value['pay_code'];?></td>
				<td><?php echo $value['pay_desc'];?></td>
				<td><a href="javascript:;"><?php echo $value['author'];?></a></td>
				<td><?php echo $value['version'];?></td>
				<td id="now_status_<?php echo $value['id'];?>"><?php if($value['enabled']) {echo "<span style='color:green;'>开启</span>";} else {echo "<span style='color:red;'>关闭</span>";} ?></td>
				
				
				<?php if($value['enabled']) {?>
				<td ><a href="<?php echo $this->_url('admin/payment/toggle/?v=0&id='.$value['id']);?>" style="cursor:pointer;text-decoration:underline;">关闭</a></td>				
				<?php }else{ ?>
				<td ><a href="<?php echo $this->_url('admin/payment/toggle/?v=1&id='.$value['id']);?>" style="cursor:pointer;text-decoration:underline;">开启</a></td>				
				<?php } ?>


			</tr>
		<?php } ?>
		</tbody>
		<tbody>
             <tr><td colspan="7">注意：1. 支付接口管理员只有开启关闭功能。			
			 <br>&#12288;&#12288;&#12288;2. 卖家可以自行选择一个或多个管理员开启的支付接口方式，并进行参数填写，才可支持相应支付接口。			
			 <br>&#12288;&#12288;&#12288;3. 更多的支付接口官方会在新版本中陆续增加。</td></tr>
			</tbody>
		</table>
		</div>
	 </div>
	</div>
</div>

<script language="JavaScript" src="<?php echo $this->_webroot('servtools/ajax_client/ajax.js'); ?>"></script>
<script language="JavaScript">
<!--
function toggle(obj,id) {
	var right=document.getElementById("pay_oper").value;
	if(right !=0){
		var v = 1;
		var d = new Date();
		var t = d.getTime();
		if(obj.innerHTML=='关闭') {
			v = 0;
		}
		ajax("<?php echo $this->_url('admin/payment/toggle/');?>?t="+t,"POST","v="+v+"&id="+id,function(data){
			if(data=='1') {
				var now_status = document.getElementById("now_status_"+id);
				if(v) {
					obj.innerHTML = '关闭';
					now_status.innerHTML = "<span style='color:green;'>开启</span>";
				} else {
					obj.innerHTML = '开启';
					now_status.innerHTML = "<span style='color:red;'>关闭</span>";
				}
			}
		});
	}else{
		ShowMessageBox("对不起，您没有权限修改!",'m.php?app=error"');
		// location.href="m.php?app=error";
	}
}
//-->
</script>
</body>
</html>